home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- // Borland C++Builder
- // Copyright (c) 1987, 1998 Borland International Inc. All Rights Reserved.
- //---------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "auto2.h"
- USERES("srvr.res");
- USEFORM("auto1.cpp", Form1);
- USETLB("srvr.tlb");
- USEUNIT("srvr_TLB.cpp");
- USEUNIT("auto2.cpp"); /* EditServer: CoClass */
- USEUNIT("srvr_ATL.cpp");
- //---------------------------------------------------------------------------
- void __fastcall InitAtlServer(void);
-
- // NOTE: You may derive a class from TComModule and use it as your server's
- // module object. (i.e. Assign an instance of that class to _Module).
- // However, you must *NOT* change the name _Module.
- //
- TComModule _ProjectModule(InitAtlServer);
- TComModule &_Module = _ProjectModule;
-
- // The ATL Object map holds an array of _ATL_OBJMAP_ENTRY structures that
- // described the objects of your OLE server. The MAP is handed to your
- // project's CComModule-derived _Module object via the Init method.
- //
- BEGIN_OBJECT_MAP(ObjectMap)
- OBJECT_ENTRY(CLSID_EditServer, TEditServerImpl)
- END_OBJECT_MAP()
- //---------------------------------------------------------------------------
- WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
- {
- try
- {
- Application->Initialize();
- Application->CreateForm(__classid(TForm1), &Form1);
- Application->Run();
- }
- catch (Exception &exception)
- {
- Application->ShowException(&exception);
- }
- return 0;
- }
- //---------------------------------------------------------------------------
- void __fastcall InitAtlServer(void)
- {
- if (SaveInitProc)
- reinterpret_cast<TProcedure>(SaveInitProc)();
- _Module.Init(ObjectMap, (HINSTANCE)HInstance);
- _Module.m_ThreadID = GetCurrentThreadId();
- _Module.m_bAutomationServer = true;
- _Module.DoFileAndObjectRegistration();
- AddTerminateProc(AutomationTerminateProc);
- }
-
- //---------------------------------------------------------------------------
-